<div class="md position-relative">
    <h2>接口调用日志</h2>
    <div class="position-right">
        筛选条件：
        <button class="btn mr-1" *ngIf="query.apiKey" (click)="queryLog('apiKey', null)">{{data?.list?data?.list[0].apiName : '接口过滤'}} x</button>
        <button class="btn mr-1" *ngIf="query.type" (click)="queryLog('type', null)">{{query.type===0?'RESTful':'Dubbo'}} x</button>
        <button class="btn mr-1" *ngIf="query.userId" (click)="queryLog('userId', null)">{{data?.list?data?.list[0].userName : 'userId=' + query.userId}} x</button>
        <button class="btn mr-1" *ngIf="query.envCode" (click)="queryLog('envCode', null)">{{query.envCode}} x</button>
    </div>
    <table class="table">
        <thead>
        <tr>
            <th>接口名称</th>
            <th>类型</th>
            <th>环境</th>
            <th>调用者</th>
            <th>调用时间</th>
            <th>响应状态</th>
            <th>响应时间（ms）</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody *ngIf="data?.list">
        <tr *ngFor="let item of data.list">
            <td><a href="javascript:" (click)="queryLog('apiKey', item.apiKey)">{{item.apiName}}</a></td>
            <td><a href="javascript:" (click)="queryLog('type', item.type)">{{item.type===0?'RESTful':'Dubbo'}}</a></td>
            <td><a href="javascript:" (click)="queryLog('envCode', item.envCode)">{{item.envCode}}</a></td>
            <td><a href="javascript:" (click)="queryLog('userId', item.userId)">{{item.userName}}</a></td>
            <td title="{{item.invokeTime|date:'yyyy-MM-dd HH:mm:ss'}}">{{item.invokeTime|date:'MM-dd HH:mm'}}</td>
            <td>{{item.status}}</td>
            <td>{{item.responseAtMillis}}</td>
            <td>
                <a [routerLink]="['/doc', docId, item.apiKey]">查看文档</a>
            </td>
        </tr>
        </tbody>
        <tfoot>
            <tr>
                <td colspan="8">
                    分页：<app-pager *ngIf="data" classes="align-right" id="pager" [pageNo]="query.pageNo" [pageSize]="query.pageSize" [total]="data.total"></app-pager>
                </td>
            </tr>
        </tfoot>
    </table>


</div>
